#include<stdio.h>
#include<math.h>

int main()
{


   char a[4],b[4],c[4];
   int f,s,t,sum;
   printf("Welcome to this game!Now please type down the three card here:\n");
   scanf("%2s %2s %2s",a,b,c);

	switch(a[0])
	{ 
	  case'j':
	  case'q':
	  case'k':
	  f=10;
	  break;
	
	  case'a':
	  f=1;
	  break;
	  
	  default:
	    f=atof(a);
	 }
	    
	switch(b[0])
	{ 
	  case'j':
	  case'q':
	  case'k':
	  s=10;
	  break;
	
	  case'a':
	  s=1;
	  break;
	  
	  default:
	    s=atof(b);
	}
	 
	switch(c[0])
	{ 
	  case'j':
	  case'q':
	  case'k':
	  t=10;
	  break;
	
	  case'a':
	  t=1;
	  break;
	  
	  default:
	    t=atof(c);
	}
	 
	sum=f+s+t;
	if(s==1||t==1||f==1)
	{
		if(sum<=11)
			sum+=10;

	}
	if(sum<=21)
	printf("You win! \n%d\n",sum);
	else
	printf("You lose!");
	
	return 0;
}
	    
	
   

